const moment = require('moment');

// 注意：此处没有考虑多语言的情况，只设置了中文
moment.locale('zh-cn');

module.exports = {
    title: '素书',
    description: 'Just playing around',
    head: [
        ['link', { rel: 'icon', href: '/assets/img/favicon.ico' }],
        ['link', { rel: 'manifest', href: '/manifest.json' }],
        ['meta', { name: 'theme-color', content: '#3eaf7c' }],
        ['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
        ['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }],
        ['link', { rel: 'apple-touch-icon', href: '/icons/apple-touch-icon-152x152.png' }],
        ['link', { rel: 'mask-icon', href: '/icons/safari-pinned-tab.svg', color: '#3eaf7c' }],
        ['meta', { name: 'msapplication-TileImage', content: '/icons/msapplication-icon-144x144.png' }],
        ['meta', { name: 'msapplication-TileColor', content: '#000000' }]
    ],
    // 时间戳插件，更改最近更新时间的时间格式
    plugins: {
        '@vuepress/last-updated': {
            transformer: (timestamp) => {
                // 不要忘了安装 moment
                return moment(timestamp).format('YYYY-MM-DD HH:mm');
            }
        },

        '@vuepress/pwa': {
            serviceWorker: true,
            updatePopup: {
                message: "发现新内容可用",
                buttonText: "刷新"
            }
        },
        '@vssue/vuepress-plugin-vssue': {
            // 设置 `platform` 而不是 `api`
            platform: 'gitee',

            // 其他的 Vssue 配置
            owner: 'lionofsheep',
            repo: 'introduction-to-vue-press',
            clientId: '955f0bc4ce0d0402462cbf7e85775a67856e22869881b685dd98d4b9d8accb51',
            clientSecret: '7b6cfe9046531dce36cbfced2fe2ecbc9ff423447bc25e24994db25256c7d64d',

            // 自动创建Issue，不用手动添加
            autoCreateIssue: true
        },
        '@vuepress/back-to-top': true
    },
    themeConfig: {
        logo: '/assets/img/favicon.ico',
        nav: [
            { text: 'Home', link: '/' },
            { text: 'SQL', link: '/SQLtutorials/' },
            { text: 'About', link: '/about/' },
            { text: 'Gitee', link: 'https://gitee.com/lionofsheep' },
            {
                text: 'Languages',
                ariaLabel: 'Language Menu',
                items: [
                    { text: 'Chinese', link: '/language/chinese/' },
                    { text: 'Japanese', link: '/language/japanese/' }
                ]
            },
        ],
        sidebar: {
            '/SQLtutorials/': [
                '',     /* /01_SQL基础教程/ */
                'one',
                'two',
                'three',
                'four'
            ],
            '/foo/': [
                // '',     /* /foo/ */
                'one',  /* /foo/one.html */
                'two'   /* /foo/two.html */
            ],
            '/guide/': [
                '',     /* /foo/ */
                'three',  /* /foo/one.html */
                'four'   /* /foo/two.html */
            ],

            // fallback
            '/': [
                '',        /* / */
                'about'    /* /about.html */
            ]
        },
        // 自动生成侧边栏
        // sidebar: 'auto',
        // 侧边栏是否展开，false为不展开
        displayAllHeaders: false, // 默认值：false
        // 最近更新时间和同步到gitee/github的时间保持一致
        lastUpdated: '更新时间', // string | boolean
        // 默认值是 true 。设置为 false 来禁用所有页面的 下一篇 链接
        nextLinks: true,
        // 默认值是 true 。设置为 false 来禁用所有页面的 上一篇 链接
        prevLinks: true,
        // 滚动条
        smoothScroll: true,


    }
}